#include "udpServer.hpp"

#include <memory>
using namespace std;
using namespace server;

static void Usage(string msg)
{
     cout << "\nUsage:\n\t" << msg << " local_port\n\n";
}

int main(int argc,char* argv[])
{
    if(argc !=2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t port = atoi(argv[1]);

    unique_ptr<UdpServer> ups(new UdpServer(port));
    ups->InitServer();
    ups->start();
    return 0;
}